# /etc/skel/.bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output.  So make sure this doesn't display
# anything or bad things will happen !


# Test for an interactive shell.  There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
	# Shell is non-interactive.  Be done now!
	return
fi


# Putting my fun stuff here.

#once upon a time, here follows a paste of flow's .bashrc, including the if interactive then fish bit

# .bashrc


#testpause20240207
# set PATH so it includes ~/bin if exists
#if [ -d "$HOME/bin" ] ; then
#    PATH="$HOME/bin:$PATH"
#fi

# if u dislike touchpad, enable this 
#synclient TouchpadOff=1
#or if you want it on, see if this re-enables it:
#synclient TouchpadOff=0
#adding that to sorter. :)

# reminder to self... i made those section headers using...  ... idk, figlet?  toilet?  which font though?
#
# ... found out, via
# for i in (ls /bedrock/strata/ceres/usr/share/figlet/) ; echo ; echo -n (ls -l /bedrock/strata/ceres/usr/share/figlet/$i) ; echo ; figlet -f $i mc ; end
# it's :
# smblock.
# figlet -f smblock headername | xclip


########################
########################
####### mc stuff #######
#
#▛▚▀▖▞▀▖
#▌▐ ▌▌ ▖
#▘▝ ▘▝▀ 
# 
#
# * Messages for package app-misc/mc-4.8.30-r2:
#
# * To enable exiting to latest working directory,
# * put this into your ~/.bashrc:
# * . /usr/libexec/mc/mc.sh
. /usr/libexec/mc/mc.sh
########################
########################


##################################################################################################
##################################################################################################
################# fish stuff #####################################################################
#  ▗▀▖▗    ▌  
#  ▐  ▄ ▞▀▘▛▀▖
#  ▜▀ ▐ ▝▀▖▌ ▌
#  ▐  ▀▘▀▀ ▘ ▘
#
############ nahhh, we dont want bash for interactive.  :3 

# If not running interactively, don't do anything
#[[ $- != *i* ]] && return

# if interactive, launch fish
[[ $- != *i* ]] && return || fish

# or try other methods from https://www.cyberciti.biz/faq/linux-unix-bash-check-interactive-shell/
##################################################################################################
##################################################################################################
##################################################################################################

##################################################################################################
##################################################################################################
##################### blesh stuff ################################################################
### ▌  ▜       ▌  
### ▛▀▖▐ ▞▀▖▞▀▘▛▀▖
### ▌ ▌▐ ▛▀ ▝▀▖▌ ▌            pssst.  this makes bash nearly as nice as zsh or fish for completion
### ▀▀  ▘▝▀▘▀▀ ▘ ▘
### blesh / ble.sh
##################
#(1/1) installing blesh-git        [########################################################] 100%
#==> To start using ble.sh, you can run "source /usr/share/blesh/ble.sh"
#==> To load ble.sh by default in interactive sessions reliably,
#==> Add this line at the top of your .bashrc:
#[[ $- == *i* ]] && source /usr/share/blesh/ble.sh --noattach
#==> Add this line at the bottom of your .bashrc:
#[[ ${BLE_VERSION-} ]] && ble-attach
#==> Documentation available at: https://github.com/akinomyoga/ble.sh/wiki
#source /usr/share/blesh/ble.sh
#### blesh:
#source /bedrock/strata/artix/usr/share/blesh/ble.sh
##################################################################################################
##################################################################################################


#####################################################################################################################
#####################################################################################################################
# prompt
#                ▐  
# ▛▀▖▙▀▖▞▀▖▛▚▀▖▛▀▖▜▀ 
# ▙▄▘▌  ▌ ▌▌▐ ▌▙▄▘▐ ▖
# ▌  ▘  ▝▀ ▘▝ ▘▌   ▀ 
PS1="\[\033[0;32m\]\$(date +%Y%m%d)\[\033[31m\]\h \[\033[33m\]\$(brl which) \[\033[0m\]\[\033[36m\]\w \[\033[0m\]\$ "
#####################################################################################################################
#####################################################################################################################

####################
####################
####### PATH #######
export PATH=$PATH:~/bin:~/.cabal/bin
####################
####################


####################
####################
####### MORE #######
#   ▗▐  
#▞▀▌▄▜▀ 
#▚▄▌▐▐ ▖
#▗▄▘▀▘▀ 

GITTINGS="$HOME/gittings/"
####################


########################
########################
####### aliases ########
#     ▜ ▗       
#  ▝▀▖▐ ▄ ▝▀▖▞▀▘
#  ▞▀▌▐ ▐ ▞▀▌▝▀▖
#  ▝▀▘ ▘▀▘▝▀▘▀▀ 
alias ovh='ssh digit@ovhtoo'
alias ovhprox='ssh -C2qTnN -D 8080 digit@ovhtoo -M -S /tmp/digit@ovhtoo:22'

#####################
####### media #######
#             
#          ▌▗    
# ▛▚▀▖▞▀▖▞▀▌▄ ▝▀▖
# ▌▐ ▌▛▀ ▌ ▌▐ ▞▀▌
# ▘▝ ▘▝▀▘▝▀▘▀▘▝▀▘
#
# load radio stations aliases
#. $GITTINGS/radiodigit/.radiorc
#same pitch at speed
alias mpv='mpv -af scaletempo'
#just music
alias mpvm='mpv --no-video $1'
#juicy
alias mplease='mpv --ytdl-format=160'
#real juicy
alias mpleep='mpv --ytdl-format=171'
#freedom fave
alias mp43='mpv --ytdl-format=43'
#bandwidthsalv
alias mp5='mpv --ytdl-format=5'
#standard
alias mp43='mpv --ytdl-format=18'
#hq
alias mp43='mpv --ytdl-format=22'

#do you have a fascbook?
fascbook(){ mp43 "https://www.youtube.com/watch?v=JotAOgXFxSs" ; facebook ; }
#facebook(){ mp43 "https://www.youtube.com/watch?v=JotAOgXFxSs" ; fascbook ; }


#formats list
#140          m4a        audio only DASH audio  131k , m4a_dash container, aac  @128k (44100Hz), 52.45MiB
#171          webm       audio only DASH audio  149k , audio@128k (44100Hz), 45.90MiB
#141          m4a        audio only DASH audio  258k , m4a_dash container, aac  @256k (44100Hz), 105.30MiB
#160          mp4        254x144    DASH video  122k , 15fps, video only, 45.56MiB
#242          webm       424x240    DASH video  217k , 1fps, video only, 78.30MiB
#133          mp4        424x240    DASH video  256k , 25fps, video only, 100.82MiB
#243          webm       636x360    DASH video  418k , 1fps, video only, 145.27MiB
#134          mp4        636x360    DASH video  615k , 25fps, video only, 221.03MiB
#244          webm       848x480    DASH video  844k , 1fps, video only, 290.09MiB
#135          mp4        848x480    DASH video 1119k , 25fps, video only, 424.25MiB
#247          webm       1270x720   DASH video 1429k , 1fps, video only, 500.26MiB
#136          mp4        1270x720   DASH video 2245k , 25fps, video only, 806.59MiB
#248          webm       1906x1080  DASH video 2849k , 1fps, video only, 1.01GiB
#137          mp4        1906x1080  DASH video 4257k , 25fps, video only, 1.37GiB
#17           3gp        176x144    
#36           3gp        320x240    
#5            flv        400x240    
#43           webm       640x360    
#18           mp4        640x360    
#22           mp4        1280x720   (best)

#################################
### RADIO GA GA ### RADIO GOO GOO

#hard house
#alias radiohardhouse='mpv ~/c/radio/hhuk.ogg.m3u'
#soundscape
#alias radiodrone='mpv ~/c/radio/dronezone56.pls'
#trance
#alias radiotrance='mpv ~/c/radio/thetrip.pls'
#elite
#alias radioelite="mpv http://listen.radionomy.com/radio-sidewinder.m3u"
#radioelite="mpv ~/c/radio/radio-sidewinder.m3u"

##############################################
####### nixos/ package manager aliases #######
#    ▗          
# ▛▀▖▄ ▚▗▘▞▀▖▞▀▘
# ▌ ▌▐ ▗▚ ▌ ▌▝▀▖
# ▘ ▘▀▘▘ ▘▝▀ ▀▀ 

# install package
alias nei='nix-env -i'
# uninstall package
alias nee='nix-env -e'
# search
alias neqag='nix-env -qa \* | grep'
alias neaqg='nix-env -qa \* | grep'
# list all available
alias neqa='nix-env -qa \*'
alias neaq='nix-env -qa \*'
# list installed 
alias neq='nix-env -q \*'
# search installed
alias neq='nix-env -q \* | grep'
# update available packages list ( i think )
alias ncu='nix-channel --update'
# upgrade --dry-run
alias neup='nix-env -u --dry-run'
alias neudr='nix-env -u --dry-run'
# upgrade (wait!  only run as root at / ... or some warning like that iirc)
alias neu='nix-env -u'
# undooooooo!
alias nerb='nix-env --rollback'
# roll back to $n
alias nesg='nix-env --switch-generation '
# list available rollbacks
alias nelg='nix-env --list-generations'
#another search
neps(){ nix-env -qa \* -P | fgrep -i "$1"; }

##### digit's new alternate nixos package search model
### update package list
alias dpu='nix-env -qa > ~/packages'
### list package
#alias dpl='cat ~/packages'
alias dpl='less ~/packages'
### search package
dps(){ cat ~/packages | grep "$1"; }
### install package
dpi(){ nix-env -i "$1"; }

############################
####### XBPS ALIASES #######
####### & FUNCTIONS. ####### 
#    ▌        
# ▚▗▘▛▀▖▛▀▖▞▀▘
# ▗▚ ▌ ▌▙▄▘▝▀▖
# ▘ ▘▀▀ ▌  ▀▀ 
alias xbps-list='xbps-list-packages-ypnosestyle'

xbps-flatlist(){
    xbps-list-packages-ypnosestyle > xqlotmp
    sed 's/$/ /g' xqlotmp | tr -d '\n' ; echo
    rm xqlotmp
}

xbps-list-packages-ypnosestyle(){
    xbps-query -m | while IFS=$'\n' read -r PKG; do echo "${PKG%-*}"; done
}

xbps-list-packages-domstyle(){
    xbps-query -m | rev | cut -d"-" -f2- | rev
}

#######################################################################
#######################################################################
#             ▗    ▜ 
# ▞▀▘▛▀▖▞▀▖▞▀▖▄ ▝▀▖▐ 
# ▝▀▖▙▄▘▛▀ ▌ ▖▐ ▞▀▌▐ 
# ▀▀ ▌  ▝▀▘▝▀ ▀▘▝▀▘ ▘s
# 
#### special one!
### as seen on archwiki for skype.
alias fyafox='xhost +local: && su fox -c firefox'

#second version, after wheel trick
alias ffox='xhost +local: && sudo -u fox /nix/store/w53y2zxglxpswfnl8y3y93jm11cr4jfx-firefox-35.0/bin/firefox'

#easy clear
alias l='clear'

#shortcut
LOADINGBAY='ovhtoo:/home/digit/stuff/ninudeskia/ryverdyak/loadingbay'

###
## funky functions

#orbea's slackware package searchery
slackpkgsearch(){
( cd /var/log/packages/ ; grep -x 'U.*M' * ) | awk -F: '{print $3 "\t" $1}' | sort -n 
}

alias f='fish'
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '

#carbs things
#CPT_PATH=$HOME/repos/carbs/core
#CPT_PATH=$CPT_PATH:$HOME/repos/carbs/extra
#CPT_PATH=$CPT_PATH:$HOME/repos/carbs/xorg
#CPT_PATH=$CPT_PATH:$HOME/repos/carbs/community
#export CPT_PATH

#load stuff from xsh
#source ~/.xsh

# Added by Radicle.
export PATH="$PATH:/home/digit/.radicle/bin"


####################
####################
####### MORE #######
# ▛▚▀▖▞▀▖▙▀▖▞▀▖
# ▌▐ ▌▌ ▌▌  ▛▀ 
# ▘▝ ▘▝▀ ▘  ▝▀▘...
